/**
 * @file Blues_keymap.h
 * @author Blues Jiang
 * @brief 
 * @version 0.1
 * @date 2022-03-26
 * 
 * @copyright Copyright (c) 2022
 * 
 */

#ifndef __BLUES_KEYCODE_H__
#define __BLUES_KEYCODE_H__

#include <rtthread.h>
#include <keycode.h>

// #define MATRIX_LAYERS 1

#define MATRIX_VIRTUAL_ROWS 1

#define MATRIX_ROWS 5
#define MATRIX_COLS 6
#define ENCODER_NUM 3

#define DIODE_ROW2COL 0
#define DIODE_COL2ROW 1

#define MATRIX_SCAN_DIRCTION DIODE_ROW2COL

/**
 * @brief Actual layout
 * 
 * [{a:7},"Esc",{x:0.25},"F1","F2","F3","F4","F5",{x:0.5},"CCW","SP1","CW",{x:1},"CCW","SP2","CW"],
 * ["~",{x:0.25},"Q","W","E","R","T"],
 * ["",{x:0.5},"A","S","D","F"],
 * ["",{x:1},"Z","X","C","V",{x:2.75},"CCW","SP3","CW"],
 * ["Hyper",{x:0.25},"Super","Meta",{w:2},"","Fn"]
 * 
 * @brief Virtual layout
 * 
 * F1   1   2   3       4       5
 * F2   Q   W   E       R       T
 * F3   A   S   D       F       En1
 * F4   Z   X   C       V       En2
 * F5   F6  F7  SPACE   F8      En3
 * En1_CCW En1_CW En2_CCW En2_CW En3_CCW En3_CW
 * 
 * 
 */

const rt_uint8_t keymaps[MATRIX_ROWS+MATRIX_VIRTUAL_ROWS][MATRIX_COLS] =
{   
    KC_F1,      KC_1,           KC_2,           KC_3,       KC_4,           KC_5,
    KC_F2,      KC_Q,           KC_W,           KC_E,       KC_R,           KC_T,
    KC_F3,      KC_A,           KC_S,           KC_D,       KC_F,           KC_ENTER,
    KC_F4,      KC_Z,           KC_X,           KC_C,       KC_V,           KC_ESCAPE,
    KC_F5,      KC_LEFT_CTRL,   KC_LEFT_ALT,    KC_SPACE,   KC_LEFT_GUI,    KC_SPACE,
    KC_PAGE_UP, KC_PAGE_DOWN,   KC_HOME,        KC_END,     KC_UP,          KC_DOWN,
};

const rt_uint8_t led_index[MATRIX_ROWS][MATRIX_COLS] = 
{
    6,  5,  4,  3,  2,  1,
    12, 11, 10, 9,  8,  7,
    17, 16, 15, 14, 13, 0,
    22, 21, 20, 19, 18, 0,
    27, 26, 25, 24, 23, 0,
};


#endif /* __BLUES_KEYCODE_H__ */

